<template>
    <div>
        <h1>近七日人口流失统计</h1>
        <!-- 确保将 receiveCity 作为属性传递 -->
        <StackedLine :city="receiveCity"></StackedLine>
    </div>
</template>

<script>
import StackedLine from './StackedLine.vue';

export default {
    components: {
        StackedLine
    },
    props: {
        receiveCity: {
            type: String,
            required: true,
            default: ''
        }
    },
    mounted() {
        console.log('当前获取到的城市2', this.receiveCity);
    },
    watch: {
        receiveCity(newValue) {
            console.log('SevenCount 组件接收到的新城市:', newValue);
            // 如果需要在此处调用方法来处理城市变更，请添加相应逻辑
        }
    }
}
</script>

<style scoped>
*{
    color: white;
}
h1{
    font-size: 25px;
    color: white;
    margin-top: 10px;
}
</style>